const axios = require("axios");

// Make a request for a user with a given ID
/* axios
  .get(
    "https://atomevo.com/magapi/tool/get?page=1&pageindex=30&method=tasks&action=get_tasks_list&token=78038fb017a8dc2eda12df7ba0f354db"
  )
  .then(function (response) {
    // response就是后端接口给我们的数据
    // handle success
    // console.log(response);
    // 拿到后端给我的真正有用的数据
    console.log("我要的数据", response.data);
  })
  .catch(function (error) {
    //   这里呢，就是如果你请求错误了，你可以在这里处理
    // handle error
    console.log(error);
  })
  .then(function () {
    // 当然你可以再发请求
    // always executed
  });
 */
/* // Optionally the request above could also be done as
axios
  .get("/user", {
    params: {
      ID: 12345,
    },
  })
  .then(function (response) {
    console.log(response);
  })
  .catch(function (error) {
    console.log(error);
  })
  .then(function () {
    // always executed
  });

// Want to use async/await? Add the `async` keyword to your outer function/method.
async function getUser() {
  try {
    const response = await axios.get("/user?ID=12345");
    console.log(response);
  } catch (error) {
    console.error(error);
  }
} */




